Page({

    data: {
        date: null,
        goods: [],
        orderId: null,
        orderPrice: null
    },
    
    onLoad (query) {
        let data = JSON.parse(query.data);
        console.log('ok');
        console.log(data);
        let date = data.orderDate;
        let timer = date;
        this.setData({
            date: timer,
            orderId: data.orderId,
            goods: data.orderDetails,
            orderPrice: data.orderPrice
        })
        console.log(timer);
        console.log(this.data.goods);
    },

    applysale (e) {
        console.log(e);
        let index = e.currentTarget.dataset.index;
        console.log(index);
        console.log(this.data.goods);
        wx.navigateTo({
            url: '../applysale/applysale?data=' + JSON.stringify(this.data.goods[index]) + '&orderId=' + JSON.stringify(this.data.orderId) + '&prderPrice=' + JSON.stringify(this.data.orderPrice)
        })
    }
})